package com.ysd.lis.controller.sta;


import com.ysd.common.Result;
import com.ysd.lis.controller.pub.BaseController;
import com.ysd.lis.dto.sta.StaBreakPointDto;
import com.ysd.lis.dto.sta.StaBreakPointMapperCategoryParam;
import com.ysd.lis.entity.sta.StaBreakPoint;
import com.ysd.lis.request.Params;
import com.ysd.lis.service.sta.StaBreakPointService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author wanghuaixing
 * @since 2024-12-25
 */
@RestController
@RequestMapping("/sta/break-point")
public class StaBreakPointController extends BaseController {

    @Autowired
    StaBreakPointService staBreakPointService;

    @ApiOperation("获取折点信息")
    @GetMapping("/findBreakPointList")
    public Result findBreakPointList(Params params) {
        return staBreakPointService.findBreakPointList(params);
    }

    @ApiOperation("获取折点信息")
    @GetMapping("/findBreakPoints")
    public Result findBreakPoints(Params params) {
        return staBreakPointService.findBreakPoints(params);
    }


    @ApiOperation("添加折点")
    @PostMapping("/addBreakPoint")
    public Result addBreakPoint(@RequestBody StaBreakPoint breakPoint) {
        return staBreakPointService.addBreakPoint(breakPoint);
    }

    @ApiOperation("修改折点")
    @PostMapping("/updateBreakPoint")
    public Result updateBreakPoint(@RequestBody StaBreakPoint breakPoint) {
        return staBreakPointService.updateBreakPoint(breakPoint);
    }


    @ApiOperation("批量删除")
    @PostMapping("/batchDeleteBreakPoint")
    public Result batchDeleteBreakPoint(@RequestBody StaBreakPointDto vo) {
        return staBreakPointService.batchDeleteBreakPoint(vo);
    }

    @ApiOperation("用户自定义折点 分类明细查询")
    @GetMapping("/findCategoryByCode")
    public Result findCategoryByCode(StaBreakPointMapperCategoryParam input) {
        return staBreakPointService.findCategoryByCode(input);
    }

    @ApiOperation("用户自定义折点 分类明细-细菌 查询")
    @PostMapping("/findGermDictListByCode")
    public Result findGermDictListByCode(@RequestBody StaBreakPointMapperCategoryParam input) {
        return staBreakPointService.findGermDictListByCode(input);
    }

    @ApiOperation("用户自定义折点 分类明细-已维护折点信息 查询")
    @PostMapping("/findBreakPointListByCode")
    public Result findBreakPointListByCode(@RequestBody StaBreakPointMapperCategoryParam input) {
        return staBreakPointService.findBreakPointListByCode(input);
    }
}
